FROM 10.232.22.108:1121/devops-release/base-images/maven:3.5.4-openjdk-8 AS builder
WORKDIR /build
COPY . .
RUN mvn clean install -Dmaven.test.skip=true --settings ./settings.xml
FROM 10.232.22.108:1121/devops-release/base-images/jdk:1.8  AS final
WORKDIR /app
COPY --from=builder /build/target/Helloword-1.0-SNAPSHOT.jar .
#EXPOSE 8080
#RUN curl http://is-web.pod3ningbo-209-174.4a.cmit.cloud:20030/api/agent/api/iast/download?version=MQ== -o iast_agent.jar
#RUN cp iast_agent.jar /app/
ENTRYPOINT ["/bin/sh","-c","curl http://is-web.pod3ningbo-209-174.4a.cmit.cloud:20030/api/agent/api/iast/download?version=MQ== -o /tmp/iast_agent.jar;java -javaagent:/tmp/iast_agent.jar -Dmoresec.agent.name=snapname -Dmoresec.agent.tag=snaptag -jar /app/Helloword-1.0-SNAPSHOT.jar"]